import request from '@/utils/request'
import requestFile from '@/utils/requestFile'

// 查询团队列表
export function listTeam(query) {
  return request({
    // url: '/eqxm/team/list',
    url: '/eqxm/team/listStar',
    method: 'get',
    params: query
  })
}

// 查询评审团队列表
export function reviewListTeam(query) {
  return request({
    url: '/eqxm/team/reviewList',
    method: 'get',
    params: query
  })
}

// 查询团队详细
export function getTeam(id) {
  return request({
    url: '/eqxm/team/' + id,
    method: 'get'
  })
}

// 新增团队
export function addTeam(data) {
  return request({
    url: '/eqxm/team',
    method: 'post',
    data: data
  })
}

// 修改团队
export function updateTeam(data) {
  return request({
    url: '/eqxm/team',
    method: 'put',
    data: data
  })
}

// 删除团队
export function delTeam(id) {
  return request({
    url: '/eqxm/team/' + id,
    method: 'delete'
  })
}

// 导出团队
export function exportTeam(query) {
  return request({
    url: '/eqxm/team/export',
    method: 'get',
    params: query
  })
}
// 导出成员
export function exportTeamMember() {
  return request({
    url: '/eqxm/team/toExcel',
    method: 'post',
    // data: query,
    timeout: 30000
  })
}

export function recommendfun(id, recommend) {
  return request({
    url: '/eqxm/team/' + id + '/' + recommend,
    method: 'delete'
  })
}
// 查询团队列表
export function listTeamForrecommend(query) {
  return request({
    url: '/eqxm/team/listTeamForrecommend',
    method: 'get',
    params: query
  })
}
// 修改团队
export function ispass(data) {
  return request({
    url: '/eqxm/team/ispass',
    method: 'put',
    data: data
  })
}

// 学生管理员下拉框
export function getstudentmanager(parm) {
  return request({
    url: '/eqxm/teamTeacher/canChooseStuList/' + parm,
    method: 'get'
  })
}

// 设置管理员
export function setPrincipal(query) {
  return request({
    url: '/eqxm/team/setPrincipal',
    method: 'get',
    params: query
  })
}

// 发送提醒
export function sendclock(data) {
  return request({
    url: '/eqxm/team/sendclock',
    method: 'put',
    data: data
  })
}
// 发送提醒 给全校负责人
export function sendclock2() {
  return request({
    url: '/eqxm/team/sendclock2',
    method: 'put',
    timeout: 20000
  })
}
// 发送打卡汇总
export function sendclock1() {
  return request({
    url: '/eqxm/team/sendclock1',
    method: 'put',
    timeout: 20000
  })
}
// 发送提醒 给全校负责人
export function sendclock3() {
  return request({
    url: '/eqxm/team/sendclock3',
    method: 'put',
  })
}

// 查询团队列表
export function getHaveReviewRole() {
  return request({
    url: '/eqxm/team/getHaveReviewRole',
    method: 'get'
  })
}


// 查询指导单位负责人列表
export function listPrincipal(query) {
  return request({
    url: '/committee/principal/list',
    method: 'get',
    params: query
  })
}

// 查询评委数据
export function listJudge(query) {
  return request({
    url: '/system/role/authUser/allocatedList',
    method: 'get',
    params: query
  })
}


export function recommendSchoolMatch(data) {
  return request({
    url: '/eqxm/team/recommendSchoolMatch/' + data,
    method: 'get'
  })
}
export function listPs(schoolSearch) {
  return request({
    url: '/eqxm/team/listPs',
    method: 'get',
    params: {
      params: {
        schoolSearch: schoolSearch,
      }
    }
  })
}

export function psSubmitForm(data, schoolSearch) {
  return request({
    url: '/eqxm/team/psSubmitForm',
    method: 'put',
    data: data,
    params: { 
      params: {
        schoolSearch: schoolSearch,
      }
     }
  })
}
export function SchoolMatchUpload(data) {
  return request({
    url: '/eqxm/team/SchoolMatchUpload',
    method: 'put',
    data: data,
    timeout: 300000
  })
}

export function downloadTemplateTeam(id) {
  return requestFile({
    url: '/eqxm/team/handleDownloadTeam/' + id,
    method: 'get'
  })
}

// 查询评审团队列表
export function listCollegeAccreditationForSchoolMatch(query) {
  return request({
    url: '/eqxm/team/listCollegeAccreditationForSchoolMatch',
    method: 'get',
    params: query
  })
}

// // 删除团队
// export function psSuccess(ids,status) {
//   return request({
//     url: '/eqxm/team/psSuccess/' + id + '/' + status,
//     method: 'delete'
//   })
// }
// 评分审核通过
export function psSuccess(ids, status,scoreType) {
  return request({
    url: '/eqxm/team/PutCollegeAccreditationForSchoolMatchStatus/' + ids + '/' + status+ '/' + scoreType,
    method: 'put',
  })
}
// 线上评分
export function SchoolMatchScoreUp(data, scoreType) {
  return request({
    url: '/eqxm/team/PutCollegeAccreditationForSchoolMatchScore',
    method: 'post',
    data: data,
    params: { scoreType: scoreType }
  })
}

// 总结材料上传列表
export function collegeDownload(params) {
  return request({
    url: '/eqxm/team/SchoolMatchUpload/download',
    method: 'get',
    params:params,
  })
}

// 下载总结材料
export function downloadSchoolMatchUpload(query) {
  return request({
    url: '/eqxm/team/SchoolMatchUpload/download',
    method: 'get',
    params: query
  })
}
// 移除校赛
export function removeSchoolmatch1(ids) {
  return request({
    url: '/eqxm/team/removeSchoolContest1/' + ids,
    method: 'put',
  })
}
// 移除校赛1
export function removeSchoolmatch2(ids) {
  return request({
    url: '/eqxm/team/removeSchoolContest2/' + ids,
    method: 'put',
  })
}
// 移除校赛2
export function removeSchoolmatch3(ids) {
  return request({
    url: '/eqxm/team/removeSchoolContest3/' + ids,
    method: 'put',
  })
}
//获取评委评分
export function listJudgesAppraisal(query) {
  return request({
    url: '/eqxm/team/listJudgesAppraisal',
    method: 'get',
    params: query
  })
}

/** 学期列表 */
export const GetYearList = payload =>
  request({
    url: '/committee/year/list',
    method: 'get',
    params: payload,
  });